from shelve import DbfilenameShelf


class StateMachine(DbfilenameShelf):

    def __init__(self, ident, *args, **kwargs):
        super().__init__('node_%s_state_machine' % ident, *args, **kwargs)

    def set(self, key, val):
        self[key] = val

    def delete(self, key):
        del self[key]
